home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IO Examples / Mines / MineTypes.dcl < prev    next >
Encoding:
Modula Definition  |  1997-04-25  |  1.5 KB  |  55 lines  |  [TEXT/3PRM]

  1. definition module MineTypes
  2.  
  3. import StdInt, StdFile
  4. import deltaPicture, deltaFont, deltaWindow
  5. import Random
  6.  
  7. ::    Minefield    :==    [[Spot]]
  8. ::    Spot        =    Mine        Visibility
  9.                 |    Empty Int    Visibility
  10. ::    Visibility    =    Visible
  11.                 |    Invisible
  12. ::    Pebbles        :==    [Position]
  13. ::    Position    :==    (!Int,!Int)
  14. ::    Time        =    Running Int
  15.                 |    Off
  16. ::    Dimension    :==    (!Int,!Int)
  17. ::    *MinesBest    :==    (Files,BestTimes)
  18. ::    BestTimes    :== (ThreeBest, ThreeBest, ThreeBest)
  19. ::    ThreeBest    :== (String,Int,String,Int,String,Int)
  20.      
  21. EasyDim            :== (8,  8)
  22. EasyMines        :== 10
  23. InterDim        :== (16,16)
  24. InterMines        :== 40
  25. HardDim            :== (30,16)
  26. HardMines        :== 99
  27.  
  28. SizeArea        :== 14
  29.  
  30. GetTime                    :: !Time -> Int
  31.  
  32. DrawCorrectnessPebble    :: Pebbles Position !Spot    !Picture -> Picture
  33.  
  34. DrawNrMines                :: !Font !Int !Dimension    !Picture -> Picture
  35. DrawTime                :: !Font !Int !Dimension    !Picture -> Picture
  36. DrawEmptyArea            :: !Position                !Picture -> Picture
  37. DrawPebble                :: !Position                !Picture -> Picture
  38. DrawSpot                :: !Position !Spot            !Picture -> Picture
  39. DrawAnySpot                :: !Position !Spot            !Picture -> Picture
  40. DrawGrid                :: !Dimension                !Picture -> Picture
  41.  
  42. SowMines                :: !Int !Dimension !RandomSeed    -> (!Minefield,!RandomSeed)
  43. GetSpot                    :: !Position !Minefield            -> Spot
  44. RevealSpot                :: !Position !Minefield            -> (!Spot,!Minefield)
  45.  
  46. NulSpot                    :: !Spot -> Bool
  47. MineSpot                :: !Spot -> Bool
  48. InvisibleSpot            :: !Spot -> Bool
  49.  
  50. RemovePebble            :: !Position !Pebbles    -> Pebbles
  51.  
  52. WindowPictDomain        :: !Dimension            -> PictureDomain
  53. MaxDimension            :: Dimension        
  54. TranslatePoint            :: !Point !Vector        -> Point
  55.